package io;

import java.io.File;
import java.lang.reflect.Field;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Li_DaChiZi
 * Date: 2025/7/2
 * Time: 10:24
 */
public class Demo6 {

    private static void scan(File currenDir) {
        if (!currenDir.isDirectory()) {
            return;
        }

        File[] files = currenDir.listFiles();
        if (files == null || files.length == 0) {
            return;
        }

        System.out.println(currenDir.getAbsolutePath());

        for (File  f: files) {
            if (f.isFile()) {
                System.out.println(f.getAbsolutePath());
            } else {
                scan(f);
            }
        }
    }


    public static void main(String[] args) {
        File file = new File(".");

        scan(file);
    }
}
